﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jayden.Dll.PathFinding;

namespace Jayden.Dll.Navigation.Core
{
	public class CorePathInformation : PathInformation
	{
		private PathNode m_Start;
		private PathNode m_End;

		public CorePathInformation(PathNode start, PathNode end)
		{
			m_Start = start;
			m_End = end;

			m_Start.Paths.Add(this);
		}

		public PathNode Start { get { return m_Start; } }
		public PathNode End { get { return m_End; } }

		public override string ToString() { return string.Format("{0} -> {1}", m_Start, m_End); }


		public bool IsOneWay
		{
			get
			{
				foreach (PathInformation path in m_End.Paths)
					if (path.End == m_Start && path.Start == m_End)
						return false;
				return true;
			}
		}
	}
}
